<% if policy(messageboard).read? %>
  <%= link_to messageboard_topics_path(messageboard), class: 'thredded--messageboard' do %>
    <header>
      <h2 class="thredded--messageboard--title"><%= messageboard.name %></h2>
      <h3 class="thredded--messageboard--meta">
        <%= t 'thredded.messageboard.topics_and_posts_counts',
              topics_count: number_to_human(messageboard.topics_count).downcase,
              posts_count:  number_to_human(messageboard.posts_count).downcase %>
      </h3>
    </header>

    <p class="thredded--messageboard--description"><%= messageboard.description %></p>

    <% if messageboard.last_topic %>
      <p class="thredded--messageboard--byline">
        <%= t 'thredded.messageboard.last_updated_by_html',
              time_ago: time_ago(messageboard.last_topic.last_post_at),
              user:     messageboard.last_user.thredded_display_name %>
      </p>
    <% end %>
  <% end %>
<% end %>
